package washingMachine

import (
	"github.com/jinzhu/gorm"
)

type WashingMachine struct {
	db     *gorm.DB
	Source ReadData
	Clean  WriteData
	Dirty  WriteData
}

type ReadData interface {
	Read(db *gorm.DB) ([]map[string]string, error)
}

type WriteData interface {
	Write([]map[string]string) error
}

func NewWashingMachine(db *gorm.DB, Source ReadData, Clean WriteData, Dirty WriteData) *WashingMachine {
	return &WashingMachine{db, Source, Clean, Dirty}
}